EXTEND: Now modify and extend your program! Make sure you meet these minimum technical requirements:

  1. Add a new scene to your story by creating a new function.
  2. Include a background and a second sprite.
  3. Don't forget to call your new function!
  4. Click Submit to share your work!

To navigate the page using the TAB key, first press ESC to exit the code editor.

sprite = codesters.Sprite("knight1", -175, -150) sprite.set_speed(2) def park_scene(): stage.set_background("park") sprite.say("I should hurry to the castle!") sprite.move_forward(550) park_scene() def bridge_scene(): stage.set_background("drawbridge") sprite.go_to(-175, -150) sprite.say("I made it!") stage.wait(2) bridge_scene() def battle_scene(): dragon = codesters.Sprite("dragon", 150, -150) sprite.say("Oh no a dragon!") sprite.move_forward(300) dragon.turn_left(360) dragon.move_down(200) sprite.say("The path is clear!") battle_scene() def reward_scene(): stage.set_background("castle") sprite.move_left(250) sprite.say(" ") wizard = codesters.Sprite("wizard", 150, -150) wizard.say("You defeated the dragon!") stage.wait(2) wizard.say("Here is your reward!") stage.wait(2) reward = codesters.Sprite("treasurechest", 0, -100) sprite.move_up(30) sprite.move_down(30) sprite.say("Hooray!") reward_scene()
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)